<?php 
class Core_Plugin_APIPlugin
    extends Zend_Controller_Plugin_Abstract
{
    public function preDispatch(Zend_Controller_Request_Abstract $request)
    {
    	//if API module, disable layout
    	if ($request->getModuleName() == 'API')
    	{
    		$front	= Zend_Controller_Front::getInstance();
    		$front->setParam('noViewRenderer', true);    		
    		
    		Zend_Layout::getMvcInstance()->disableLayout(true);	
    		$this->getResponse()->setHeader('Content-Type', 'text/xml', true);
    	}        
    }
}